import 'package:hello_word/models/favorite_model.dart';
import 'package:hello_word/models/locale_model.dart';
import 'package:hello_word/models/theme_model.dart';
import 'package:hello_word/models/user_model.dart';
import 'package:provider/provider.dart';
import 'package:provider/single_child_widget.dart';

List<SingleChildWidget> providers = [
  ...independentServices,
  ...dependentServices,
  ...uiConsumableProviders
];

List<SingleChildWidget> independentServices = [
  ChangeNotifierProvider<ThemeModel>(create: (context) => ThemeModel()),
  ChangeNotifierProvider<LocaleModel>(create: (context) => LocaleModel()),
  ChangeNotifierProvider<GlobalFavouriteStateModel>(
      create: (context) => GlobalFavouriteStateModel()),
];

List<SingleChildWidget> dependentServices = [
  ChangeNotifierProxyProvider<GlobalFavouriteStateModel, UserModel>(
      create: null,
      update: (context, globalFavouriteStateModel, userModel) =>
          userModel ??
          UserModel(globalFavouriteStateModel: globalFavouriteStateModel)),
];

List<SingleChildWidget> uiConsumableProviders = [
  // StreamProvider<UserModel>(
  //   builder: (context) => Provider.of<AuthenticationService>(context, listen: false).user,
  // ),
];
